package com.cts.learninglibrary.pojo;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * @author: kwanghuee
 * @date: 2020/8/18 9:12
 */
@Data
@TableName("comment")
@ApiModel(value = "评论表")
public class Comment {

    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "主键id", required = true)
    private Integer id;

    @ApiModelProperty(value = "用户id", required = true)
    private Integer userId;

    @ApiModelProperty(value = "所属父级id", required = true)
    private Integer parentId;

    @TableLogic
    @ApiModelProperty(value = "状态值（1：删除/0：非删除）", required = true)
    private Integer status;

    @ApiModelProperty(value = "分享id", required = true)
    private Integer shareId;

    @ApiModelProperty(value = "评论内容", required = true)
    private String content;


    @ApiModelProperty(value = "操作时间", required = true)
    private Timestamp operateTime;

    /*表示当前属性不是数据库的字段*/
    @TableField(exist = false)
    @ApiModelProperty(value = "被评论的用户昵称", required = true)
    private String reviewedNickname;

    /*表示当前属性不是数据库的字段*/
    @TableField(exist = false)
    @ApiModelProperty(value = "二级评论", required = true)
    private List<Comment> Children = new ArrayList<>();

    /*表示当前属性不是数据库的字段*/
    @TableField(exist = false)
    @ApiModelProperty(value = "评论的用户昵称", required = true)
    private String nickname;
}
